export const genMessage = (langs: Record<string, Record<string, any>>, langType: string) => {
  const message = {} as Recordable;
  Object.keys(langs).forEach((path) => {
    const lang = langs[path].default;
    if (!lang) {
      return;
    }
    const regFile = /(.*)\..*/g;
    const splitList = path.split('/');
    const fileName = splitList[splitList.length - 1];
    const result = regFile.exec(fileName);
    let filePrefix = '';
    if (result && result.length > 1) {
      filePrefix = result![1];
    }
    const module = { [filePrefix]: lang };
    Object.assign(message, module);
  });
  return message;
};
